#include <iostream>
#include <stdexcept>
#include <vector>
#include <ginac/ginac.h>
#include "sector_decomposition/sector_decomposition.h"

int main()
{

  try{

    using namespace sector_decomposition;
    using namespace GiNaC;

    std::cout << "testsuite sector decomposition" << std::endl;
    std::cout << std::endl;

    // --------------------------------------------------------------
    int verbose_level = 1;

    CHOICE_STRATEGY = STRATEGY_C;

    // --------------------------------------------------------------
    monte_carlo_parameters mc_parameters = monte_carlo_parameters( 5, 15, 10000, 100000 );

    // --------------------------------------------------------------
    // calculates int_0^1 dx x^(-1/2 + eps) (1-x)^(-1/2 + eps)

    symbol eps("eps");
    int order = 0;

    int n     = 1;

    std::vector<ex> parameters;
    symbol x1("x1");
    parameters.push_back(x1);

    integration_data global_data = integration_data(parameters, eps, order);

    std::vector<exponent> nu_minus_1(n);
    nu_minus_1[0] = exponent(numeric(-1,2),1);

    ex F = 1-x1;

    std::vector<ex> poly_list;
    poly_list.push_back(F);

    std::vector<exponent> c(poly_list.size());
    c[0] = exponent(numeric(-1,2),1);

    integrand my_integrand = integrand(nu_minus_1, poly_list, c);

    // --------------------------------------------------------------

    monte_carlo_result res = do_sector_decomposition_cube(global_data, my_integrand, mc_parameters, verbose_level);

    // --------------------------------------------------------------

  } catch (std::exception &e)
    {
      std::cout << "Exception : " << e.what() << std::endl;
    }

  return 0;
}

